Disposing of Apple Event Data Structures
Likewise, when you extract a descriptor record by using
copy of the descriptor record for you to use.
Whenever you are done using a descriptor record or descriptor list that you
have created or extracted from an Apple event, you must dispose of the
descriptor record-and thereby deallocate the memory it uses-by calling the
Also, when you are done using the Apple event specified in the AESend function and finished with the reply Apple event, you should dispose of their
descriptor records using the AEDisposeDesc function. You should dispose of them even if AESend returns a nonzero result code. Once you are done using them, you should dispose of any Apple event data
structures created or returned by these functions:
Even if you add a descriptor record to an Apple event (for example, when you
create a descriptor record by calling AECreateDesc and then put a copy of it still responsible for disposing
of the original descriptor record.
Apple event data structures for you: when your handler returns to
event and the reply Apple event. Note that your handler is still responsible for
disposing of any Apple event data structures created when extracting data from
the Apple event. The Apple event and reply Apple event that your handler
receives are only copies of the originals. The client application is responsible
for disposing of the original data structures.